<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="BannerInfo">
    <div class="layui-card-body padding-left-40 layui-col-space10">
        {include file='search', type="form"}
        <div class="layui-col-md12">
            <label class="layui-form-label">{:Lang("渠道名字")}:</label>
            <div class="layui-input-block">

                <input required name="title" value='{$vo.title|default=""}' lay-verify="required" class="layui-input " vali-name="{:lang('标题')}" >
            </div>
        </div>
        <div class="layui-col-md12">
            <label class="layui-form-label">{:Lang("自定编号")}:</label>
            <div class="layui-input-block">

                <input required name="code" value='{$vo.code|default=""}' lay-verify="required" class="layui-input " vali-name="{:lang('标题')}" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label label-required-next">{:lang('快递')}</label>
            <div class="layui-input-block">
                <select name='express_id' class='layui-select express' >
                    <option value=''> </option>
                    {foreach $express_arr as $key => $name}

                    <option value='{$key}' {if isset($vo.express_id) &&  $vo.express_id eq $key} selected {/if} >{$name|raw}</option>

                    {/foreach}
                </select>

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label label-required-next">{:lang('所属国家')}</label>
            <div class="layui-input-block">
                <select name='country_code' class='layui-select country_code' lay-search>
                    <option value='{$vo.country_name|default=""}'> </option>
                    {foreach $country_arr as $key => $name}

                    <option value='{$key}'   >{$name|raw}</option>

                    {/foreach}
                </select>

            </div>
        </div>
    </div>


    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>

<script>


    // 指向元素为 `<select lay-filter="test"></select>` 的选择事件
    form.on('select(account)', function(data){


        let account_id = data.value;
        get("{:sysuri('jiyun/common/getExpress')}", {account_id:account_id}, function (res) {

            let data = res.data;
            let html = '';
            for (let i in data) {
                html += '<option value="'+ i +'">'+ data[i] +'</option>'
            }

            $('.express').html(html);
            form.render($('.express'));

        })
    })

</script>